﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using XYTXL.AppCode;
using XYTXL.API;
using XYTXL.Data;

namespace XYTXL.View
{
    public partial class MangerBJ : BasePage
    {


        public string ID
        {
            get
            {
                return Request.QueryString["ID"].ToString();
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitialData();
            }
        }

        protected void btAddBranch_Click(object sender, EventArgs e)
        {
            int BJID = int.Parse(ID);
            xy_bj bj = new xy_bjB().GetEntities(d => d.ID == BJID).SingleOrDefault();
            bj.glyxh = conBZR.Text;
            bj.bjqq = conBJQQ.Text;
            bj.bjwx = conBJWX.Text;
            new xy_bjB().Update(bj);

        }

        /// <summary>
        /// 服务器端验证
        /// </summary>
        /// <returns></returns>


        public void InitialData()
        {
            int BJID = int.Parse(ID);

            xy_bj bj = new xy_bjB().GetEntities(d => d.ID == BJID).SingleOrDefault();
            conBJQQ.Text = bj.bjqq;
            conBJWX.Text = bj.bjwx;
            conBZR.Text = bj.glyxh;

        }
    }
}